package com.web.controller;

import java.io.IOException;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.sys.Utils.FileUtils;

@Controller
@RequestMapping("/fileUpload")
public class FileUploadController {

	@RequestMapping("")
	public @ResponseBody String
	FileUpload(@RequestParam(required = false, value = "contractFile") MultipartFile contractFile) throws IOException {
		String img = "<img src=\""+FileUtils.uploadImg(contractFile)+"\"></img>";
		return img;
	}
}
